import { upload } from '@/utils/request';

const uploadFile = async (file: File) => {
    try {
        const result = await upload<{ url: string }>('/upload', file);
        console.log('文件上传成功:', result.url);
        return result.url;
    } catch (error) {
        console.error('文件上传失败:', error);
        return null;
    }
};
